//
//  VCOfForgotPassword.m
//  UIHomeWork01
//
//  Created by tusm on 16/7/16.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "VCOfForgotPassword.h"

@interface VCOfForgotPassword ()

@end

@implementation VCOfForgotPassword

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self CreateSecondPage];
}

- (void)CreateSecondPage{
    
    //返回键
    UIButton *button = [UIButton buttonWithType:UIButtonTypeContactAdd];
    [button setImage:[UIImage imageNamed:@"back1"] forState:UIControlStateNormal];
    [button setTitle:@"返回" forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont systemFontOfSize:28.0f];
    button.tintColor = [UIColor colorWithRed:0.00 green:0.67 blue:0.53 alpha:1.00];
    button.frame = CGRectMake(10, 10, 80, 60);
    [button addTarget:self action:@selector(handleBack) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    CGFloat imageWidth = button.imageView.bounds.size.width;
    CGFloat imageHeight = button.imageView.bounds.size.height;
    button.titleEdgeInsets = UIEdgeInsetsMake(0, imageWidth, 0, imageHeight);
    //Lable
    UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(150, 50, 150, 60)];
    lable.text = @"验证手机";
    lable.font = [UIFont systemFontOfSize:22];
    [self.view addSubview:lable];
    
    //textField---phoneNumber
    UITextField *PhoneNumber = [[UITextField alloc] initWithFrame:CGRectMake(30, 130, self.view.frame.size.width - 20, 50)];
    [self.view addSubview:PhoneNumber];
    PhoneNumber.placeholder = @"   手机号 (仅支持中国大陆号)";
    PhoneNumber.font = [UIFont systemFontOfSize:18];
    PhoneNumber.leftViewMode = UITextFieldViewModeAlways;
    PhoneNumber.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    UIImageView  *imagePhone = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"shouji"]];
    PhoneNumber.leftView = imagePhone;
    //线1
    UIView *viewline1 = [[UIView alloc] initWithFrame:CGRectMake(30, 180, self.view.frame.size.width - 60, 1)];
    viewline1.backgroundColor = [UIColor lightGrayColor];
    [self.view addSubview:viewline1];
    
    //textField--VerificationCode
    UITextField * VerificationCode = [[UITextField alloc] initWithFrame:CGRectMake(30, 190, self.view.frame.size.width - 20, 50)];
    [self.view addSubview:VerificationCode];
    VerificationCode.placeholder = @"   验证码";
    VerificationCode.font = [UIFont systemFontOfSize:18];
    VerificationCode.leftViewMode = UITextFieldViewModeAlways;
    VerificationCode.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    UIImageView *imageCode = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yanzhengma"]];
    VerificationCode.leftView = imageCode;
    VerificationCode.rightViewMode = UITextFieldViewModeAlways;
    VerificationCode.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    //验证码
    UIButton *buttonOfCode = [UIButton buttonWithType:UIButtonTypeCustom];
    [buttonOfCode setTitle:@"获取验证码" forState:UIControlStateNormal];
    [buttonOfCode setTitleColor:[UIColor colorWithRed:0.00 green:0.67 blue:0.53 alpha:1.00] forState:UIControlStateNormal];
    VerificationCode.rightView = buttonOfCode;
    
    
    //线2
    UIView *viewline2 = [[UIView alloc] initWithFrame:CGRectMake(30, 240, self.view.frame.size.width - 60, 1)];
    viewline2.backgroundColor = [UIColor lightGrayColor];
    [self.view addSubview:viewline2];
    
    
    //buttont ---next
    UIButton *nextStep = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    nextStep.frame = CGRectMake(30, 250, self.view.frame.size.width-60, 50);
    nextStep.backgroundColor = [UIColor colorWithRed:0.00 green:0.67 blue:0.53 alpha:1.00];
    [nextStep setTitle:@"下一步" forState:UIControlStateNormal];
//    [nextStep addTarget:self action:@selector(handleButton) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:nextStep];
    [nextStep setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    
    UILabel *labelOfEnd = [[UILabel alloc] initWithFrame:CGRectMake(30, 310, 20, 20)];
    labelOfEnd.numberOfLines = 1;
    labelOfEnd.font = [UIFont boldSystemFontOfSize:17.0f];
    NSString *str = @"邮箱用户找回密码,请";
    CGSize sizeOfStr = [str sizeWithFont:labelOfEnd.font constrainedToSize:CGSizeMake(MAXFLOAT, labelOfEnd.frame.size.height)];
    [labelOfEnd setFrame:CGRectMake(30, 310, sizeOfStr.width, 20)];
    labelOfEnd.text = str;
    [self.view addSubview:labelOfEnd];
    
    UIButton *buttonOfEnd = [UIButton buttonWithType:UIButtonTypeSystem];
    [buttonOfEnd setTitle:@"点击这里" forState:UIControlStateNormal];
//    buttonOfEnd.titleLabel.font = [UIFont systemFontOfSize:16];
    buttonOfEnd.frame = CGRectMake(30 + sizeOfStr.width, 310, 60, 20);
    [buttonOfEnd setTitleColor:[UIColor colorWithRed:0.00 green:0.67 blue:0.53 alpha:1.00] forState:UIControlStateNormal];
    [self.view addSubview:buttonOfEnd];
    
}

- (void)handleBack{

    [self dismissViewControllerAnimated:NO completion:^{
        
    }];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
